CC = gcc
AFLAGS =-Wall -c -g
LDFLAGS = -lpcap  
OBJS = cap_manager.o pcap.o convert.o raw.o main.o

capture :$(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)
	
dep_files := $(foreach f,$(OBJS),.$(f).d)
dep_files := $(wildcard $(dep_files))

ifneq ($(dep_files),)
  include $(dep_files)
endif

$(OBJS):%.o:%.c
	$(CC) -Wp,-MD,.$@.d  $(AFLAGS) $< -o $@
  
clean:
	rm -rf .*.o.d *.o
